namespace KeppelLand.Entities
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    /*
     * Status  - Description
     * 0       - Draft -> Cleared by self
     * 1       - Submit to  RO
     * 2       - Cleared by RO
     * 3       - Submit to  AO
     * 4       - Cleared by AO -> Pending HR
     * 
    */
    /// <summary>
    /// Status  - Description
    /// 0       - Draft -> Cleared by self
    /// 1       - Submit to  RO
    /// 2       - Cleared by RO
    /// 3       - Submit to  AO
    /// 4       - Cleared by AO -> Pending HR
    /// 5       - Pending HR
    /// 6       - Cleared by HR
    /// 7       - Export to SAP
    /// </summary>
    public enum ClaimStatus
    {
        DRAFT = 0,
        SUBMITTED_TO_RO = 1,
        CLEARED_BY_RO = 2,
        SUBMITTED_TO_AO = 3,
        CLEARED_BY_AO = 4,
        SUBMITTED_TO_HR = 5,
        CLEARED_BY_HR = 6,
        EXPORT_TO_SAP = 7
    }

    public partial class RejectionDetailView
    {
        public string RejectorId { get; set; }
        public string RejectDate { get; set; }
        public string RejectReason { get; set; }
    }

    public partial class RejectionDetail
    {
        public string RejectorId { get; set; }
        public DateTime? RejectDate { get; set; }
        public string RejectReason { get; set; }
    }

    public partial class Claim
    {
        public int Id { get; set; }
        public string EntryOwner { get; set; }
        public DateTime EntryDateTime { get; set; }

        public DateTime ClaimDate { get; set; }
        public DateTime? StartWorkTime { get; set; }
        public DateTime? EndWorkTime { get; set; }
        public DateTime? StartOverTime { get; set; }
        public DateTime? EndOverTime { get; set; }
        public decimal? BreakHours { get; set; }

        public decimal? OT1_5 { get; set; }
        public decimal? OT2_0 { get; set; }
        public bool? PH { get; set; }
        public bool? RD4 { get; set; }
        public bool? RD8 { get; set; }

        public decimal? AlwMeal { get; set; }
        public decimal? AlwShft { get; set; }
        public string ShiftType { get; set; }
        public string Remark { get; set; }

        public byte? Status { get; set; }
        public DateTime? SubmissionDate { get; set; }

        public string RecommenderId { get; set; }
        public DateTime? RecommendDate { get; set; }
        public string ApproverId { get; set; }
        public DateTime? ApproveDate { get; set; }
        public string RejectorId { get; set; }
        public DateTime? RejectDate { get; set; }
        public string RejectReason { get; set; }

        public string Exported { get; set; }

        public string TotalOTHours
        {
            get
            {
                if ((StartOverTime.HasValue) && (EndOverTime.HasValue) && (StartOverTime.Value < EndOverTime.Value))
                {
                    return (Math.Floor((EndOverTime.Value - StartOverTime.Value).TotalHours * 100) / 100).ToString();
                }
                else
                {
                    return string.Empty;
                }

            }
        }

        public DateTime? HRClearedDate { get; set; }

        public string Section { get; set; }
    }
}